import request from '@/utils/request'

const prefixUrl = 'web/bill-market/'

// 列表分页
export function list(params) {
  return request({
    url: prefixUrl + 'list',
    method: 'get',
    params
  })
}

// 详情
export function detail(params) {
  return request({
    url: prefixUrl + 'detail',
    method: 'get',
    params
  })
}

// 保存至草稿箱
export function save(data) {
  return request({
    url: prefixUrl + 'save',
    method: 'post',
    data: data,
    content_type: 'json'
  })
}

// 提交
export function begin(data) {
  return request({
    url: prefixUrl + 'begin',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

// 通过
export function pass(data) {
  return request({
    url: prefixUrl + 'pass',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

// 驳回
export function return_back(data) {
  return request({
    url: prefixUrl + 'return_back',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

// 删除
export function remove(params) {
  return request({
    url: prefixUrl + 'delete',
    method: 'delete',
    params
  })
}

// 彻底删除
export function actual_delete(params) {
  return request({
    url: prefixUrl + 'actual_delete',
    method: 'delete',
    params
  })
}

// 上传设计稿
export function upload_design_pic(data) {
  return request({
    url: prefixUrl + 'upload-design-pic',
    method: 'post',
    data,
    content_type: 'json'
  })
}

// 生成确定单
export function generate_confirm_bill(data) {
  return request({
    url: prefixUrl + 'generate-confirm-bill',
    method: 'put',
    data,
    content_type: 'json'
  })
}

// 确定单详情
export function confirm_bill_detail(params) {
  return request({
    url: prefixUrl + 'confirm-bill-detail',
    method: 'get',
    params
  })
}

// 确定单详情
export function sign_confirm_bill(data) {
  return request({
    url: prefixUrl + 'sign-confirm-bill',
    method: 'put',
    data,
    content_type: 'json'
  })
}

// 修改拍照要求
export function modify_shoot_requirement(data) {
  return request({
    url: prefixUrl + 'modify-shoot-requirement',
    method: 'post',
    data,
    content_type: 'json'
  })
}

// 确认拍照要求
export function confirm_shoot_requirement(params) {
  return request({
    url: prefixUrl + 'confirm-shoot-requirement',
    method: 'post',
    params
  })
}

// 根据customerId获取市场单列表（制作单使用）
export function list_latest_for_ad_make_by_customer_id(params) {
  return request({
    url: prefixUrl + '/list-latest-for-ad-make-by-customer-id',
    method: 'get',
    params
  })
}

/*===================NEW 2023.09.12 By GXH====================*/
// 详情
export function detailNew(params) {
  return request({
    url: prefixUrl + 'detail-new',
    method: 'get',
    params
  })
}

export function subDetail(params) {
  return request({
    url: prefixUrl + 'sub-detail',
    method: 'get',
    params
  })
}

export function initMarketBill(params) {
  return request({
    url: prefixUrl + 'init-market-bill',
    method: 'get',
    params
  })
}

// 保存至草稿箱
export function saveNew(data) {
  return request({
    url: prefixUrl + 'save-new',
    method: 'post',
    data: data,
    content_type: 'json'
  })
}

// 提交
export function beginNew(data) {
  return request({
    url: prefixUrl + 'begin-new',
    method: 'put',
    data: data,
    content_type: 'json'
  })
}

// 列表分页
export function listNew(params) {
  return request({
    url: prefixUrl + 'list-new',
    method: 'get',
    params
  })
}

// 列表分页
export function listDetail(params) {
  return request({
    url: prefixUrl + 'list-detail',
    method: 'get',
    params
  })
}

export function initNewMarketBill(data) {
  return request({
    url: prefixUrl + 'init-new-market-bill',
    method: 'post',
    data: data,
    content_type: 'json'
  })
}





